<!--
 * @Author: HuangBingQuan <17671241237@163.com>
 * @Date: 2025-01-16 16:30:14
 * @LastEditTime: 2025-01-16 16:33:01
 * @FilePath: /low-code-platform/src/components/SurveyComs/EditItems/TitleEditor.vue
-->
<template>
    <div key="id">
        <div class="mb-10">标题内容</div>
        <el-input placeholder="" v-model="text" @update:modelValue="inputHandle"/>
    </div>
</template>

<script setup lang="ts">
    import type { VueComType } from "@/types"
    import { onMounted, ref, inject } from "vue";
    const props = defineProps<{
        status: string,
        isShow: boolean,
        configKey: string,
        editCom: VueComType,
        id: string
    }>();
    const text = ref(props.status);

    const updateStatus = inject('updateStatus');

    onMounted(()=> {
        console.log(props.configKey);
        console.log('updateStatus', updateStatus);
    })

    function inputHandle(newVal: string) {
        updateStatus(props.configKey, newVal);
    }
    // const MaterialStore = useMaterialStore();
    // const changeIpt = (e: Event)=> {
    //     // const value = e.target!.value;
    //     MaterialStore.$state.coms[MaterialStore.$state.currentMaterialCom].status.title.status = e.target!.value;
    //     // console.log(MaterialStore.$state.coms[MaterialStore.$state.currentMaterialCom].status.title.status);
    // }
</script>

<style lang="scss" scoped></style>
